package oop2;

import oop.TestStatic;

import java.util.Arrays;

public class TestString {
    public static void main(String[] args) {
        String s1 = "121";
        int a = Integer.parseInt(s1);
        System.out.println(a+1);
        a = 233;//233+"";
        s1 = String.valueOf(a);
        System.out.println(s1+1);
        String url = "www.baidu.com";
        String name = url.substring(4,9);
        System.out.println(name);
        int index01 = url.indexOf(".");//第一个点的小标
        int index02 = url.lastIndexOf(".");//最后一个点的下标
        name = url.substring(index01+1,index02);
        System.out.println(name);

       /* name = url.substring(url.indexOf(".")+1,
                url.lastIndexOf("."));*/


        System.out.println(name);
        url = url.replace("baidu","google");
        System.out.println(url);


        /*String str = "郝振宇,田龙,白云天,李发荣";
        String[] names = str.split(",");
        for(int i=0;i<names.length;i++){
            System.out.println(names[i]);
        }
        double[] scores  = new double[names.length];
        for(int i=0;i<scores.length;i++){
            scores[i] = (int)(Math.random()*100)+1;
        }
        for(int i=0;i<names.length;i++){
            System.out.println(names[i]+"的成绩是:"+scores[i]);
        }*/


//        String str = "abcdefgghkladsfjl;";
//        char c = str.charAt(0);
//        System.out.println(c);
    }
}
